package main

import (
	"container/list"
	"container/ring"
	"fmt"
)

func main() {
	test_map()
	test_list()
	test_ring()
}

func test_map() {
	m1 := map[int64]string{2: "2", 3: "3"}
	m2 := make(map[int64]string)

	m1[1] = "1"
	m2[1] = "1"

	for key, value := range m1 {
		fmt.Println(key, value)
	}
}

func test_list() {
	l := list.New()

	v1 := l.PushFront(1)
	v2 := l.PushFront(2)
	v3 := l.PushBack(3)

	l.Remove(v1)
	l.Remove(v2)
	l.Remove(v3)

	for ele := l.Front(); ele != nil; ele = ele.Next() {
		l.Remove(ele)
	}
}

func test_ring() {
	r1 := ring.New(1)
	r2 := ring.New(2)

	r1.Link(r2)
	r1.Unlink(1)
	r1.Move(2)
}
